﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GcmpDatabaseInterface.h"
#include "GbmpQuickCast.h"
#include "IDbObject.h"

namespace gcmp
{
    class IElement;
    /// \brief 不含有ElementId的Db层数据的基类
    ///
    /// 用于应框架扩展要求，需要被框架Db层支持、但不能含有对其它对象引用的类，从此类派生。
    /// 框架会检查其直接和间接成员是否含有ElementId。
    class GCMP_DATABASE_INTERFACE_EXPORT INoElementIdDbObject : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::INoElementIdDbObject, gcmp::IDbObject)
    public:
        /// \brief 析构函数
        virtual ~INoElementIdDbObject(void) = 0;

    public:
        /// \brief 设置该组件所属Element
        /// \param pOwnerElement 所属Element
        /// \return bool
        virtual bool SetOwnerElement(IElement* pOwnerElement) = 0;

        /// \brief 获得该组件所属的Element
        /// \return 所属的Element
        virtual IElement* GetOwnerElement() = 0;

        /// \brief 获得该组件所属的Element
        /// \return 所属的Element
        virtual const IElement* GetOwnerElement() const = 0;
    };
}

